package com.example.kotlinstudy

import android.animation.ObjectAnimator
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity

class Main4Activity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.main_activity4)
        val test1Bean = intent.getSerializableExtra("data") as Test1Bean
        XLog.e("####$test1Bean")
//Parcelize 还不成熟传过来是空的
        val test2Bean = intent.getParcelableExtra<Test2Bean>("data1")
        XLog.e("####$test2Bean")
    }

    //传多值，可变参数
    fun click01(view: View) {
        var params = floatArrayOf(200.0f, view.left / 1.0f)
        val objectAnimator = ObjectAnimator.ofFloat(view, "translationX", *params)
        objectAnimator.setDuration(300)
        objectAnimator.start()
    }
}
